<template>
    <div class="navBar">
        <div class="items">
            <router-link to="/">
                <img src="../../assets/home.png" alt="home" class="picture">
                <span class="text">首页</span>
            </router-link>
        </div>
        <div class="items">
            <router-link to="/classify">
                <img src="../../assets/class.png" alt="home" class="picture">
                <span class="text">分类</span>
            </router-link>
        </div>
        <div class="items shopping1">
            <router-link to="/shopping">
                <img src="../../assets/shopping.png" alt="home" class="picture">
                <span class="text shopping2">购物</span>
            </router-link>
        </div>
        <div class="items">
            <router-link to="/account">
                <img src="../../assets/people.png" alt="home" class="picture">
                <span class="text">我的</span>
            </router-link>
        </div>
    </div>
</template>

<script setup>
</script>


<style scoped>
.navBar {
    display: flex;
    justify-content: space-around;
    position: fixed; /* 导航栏固定在底部 */
    bottom: 0 ;
    left: 0;
    right: 0;
    background-color: #f8f8f8;
    height: 4rem;
    z-index: 10000;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* 添加底部阴影效果 */
}

.items {
    
    padding-top: 5px; /* 顶部内边距 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 6rem; /* 设置每个导航项的最小宽度 */
}

.picture {
    width: 2rem; /* 图标宽度 */
    height: 2rem; /* 图标高度 */
    margin-bottom: 0; /* 移除图片与文字之间的默认间距 */
}

.text {
    font-size: 14px; /* 文本字体大小 */
    color: #333; /* 文本颜色 */
}

/* 手机端适配 */
@media (max-width: 768px) {
    .navBar {
        justify-content: space-evenly; /* 在小屏幕上更加均匀地分配导航项空间 */
    }
}
</style>